﻿using System;
using System.Configuration;
using System.Collections.Generic;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Wicresoft.RSS.Engine;
using Wicresoft.Framework.Organization;
using Wicresoft.Common;

public partial class Rss_GiftRssInfoList : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Clear();
        RSSObj obj = new RSSObj();
        obj.Title = "待审核的公务接待申请";
        obj.Link = ConfigurationManager.AppSettings["ApplicationServer"] + this.Request.ApplicationPath + "/Gift/LeaderVerifyPageList.aspx";

        if (!string.IsNullOrEmpty(Request.QueryString["user"]))
        {
            User user = OrganizationPublicHelper.GetUserInfo(Request.QueryString["user"]);
            string DepartmentName = user.GetMainDepartment().DisplayName;
            int recordCount = 0;

            DataTable dt = DataAccess.Select(typeof(Wicresoft.JDPostBoard.Entity.ApplyLog), 0, 50, "Status='待审核' ", "ApplyTime DESC", ref recordCount);

            foreach (DataRow dr in dt.Rows)
            {
                RSSItem item = new RSSItem();
                item.Title = dr[Wicresoft.JDPostBoard.Entity.ViewGiftApply.SQLCOL_APPLYTITLE].ToString();
                item.Link = ConfigurationManager.AppSettings["ApplicationServer"] + this.Request.ApplicationPath + "/Gift/ApplyView.aspx?UserType=4&ApplyID=" + dr[Wicresoft.JDPostBoard.Entity.ViewGiftApply.SQLCOL_APPLYID].ToString();
                item.PubDate = DateTime.Parse(dr[Wicresoft.JDPostBoard.Entity.ViewGiftApply.SQLCOL_APPLYTIME].ToString());
                item.IsRead = 0;
                obj.Items.Add(item);
            }
        }
        Response.Write(obj.XML.OuterXml);
        Response.End();
    }
}